Another absurdity of the golden calf story is that the people were punished for doing something they didn't know was forbidden. The israelites had been in Egypt without knowledge of the hebrew god and had no idea what his requirements were. Moses hadn't even come down the mountain with the commandments yet and they couldn't even see their wrongdoing in retrospect cos he smashed them.
The census taking by David is a strange one too. There are two conflicting scriptures about who actually told David to take the census in the first place. In Samuel it says god told him to take it and in Chronicles it says satan.